proc do_userlist {nick chan host otbn1} {
global botnick home bcast    
if {![validchan $chan]} {
  putserv "NOTICE $nick :$chan isn't a registered channel."
  return 0
  }
if {$otbn1 == ""} {
  putlog "!$nick ($host)! userlist $chan"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested the userlist for $chan ...showing..."
  }
  putserv "NOTICE $nick :Current user listing for $chan:"
  putserv "NOTICE $nick :[userlist |f $chan]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access #channel <user>"
  return 0
  }
if {$otbn1 == "avoice"} {
  putlog "!$nick ($host)! userlist $chan avoice"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for avoice users in $chan ..showing.."
  }
  putserv "NOTICE $nick :Current user listing for avoice users in $chan:"
  putserv "NOTICE $nick :[userlist |v $chan]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
if {$otbn1 == "op"} {
  putlog "!$nick ($host)! userlist $chan op"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for op users in $chan ..showing..."
  }
  putserv "NOTICE $nick :Current listing for op users in $chan:"
  putserv "NOTICE $nick :[userlist |o $chan]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
if {$otbn1 == "ccadmin"} {
  putlog "!$nick ($host)! userlist $chan ccadmin"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for ccadmin users in $chan ..showing..."
  }
  putserv "NOTICE $nick :Current listing for ccadmin users in $chan:"
  putserv "NOTICE $nick :[userlist |m $chan]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
if {$otbn1 == "cadmin"} {
  putlog "!$nick ($host)! userlist $chan cadmin"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for cadmin users in $chan ..showing..."
  }
  putserv "NOTICE $nick :Current listing for cadmin users in $chan:"
  putserv "NOTICE $nick :[userlist |n $chan]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
if {$otbn1 == "bop"} {
  putlog "!$nick ($host)! userlist bop"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for bop users ..showing..."
  }
  putserv "NOTICE $nick :Current listing for bop users:"
  putserv "NOTICE $nick :[userlist o]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
if {$otbn1 == "bcadmin"} {
  putlog "!$nick ($host)! userlist bcadmin"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for bcadmin users ..showing..."
  }
  putserv "NOTICE $nick :Current listing for bcadmin users:"
  putserv "NOTICE $nick :[userlist m]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
if {$otbn1 == "root"} {
  putlog "!$nick ($host)! userlist root"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested userlist for root users ..showing..."
  }
  putserv "NOTICE $nick :Current listing for root users:"
  putserv "NOTICE $nick :[userlist n]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }  
if {$otbn1 == "global"} {
  putlog "!$nick ($host)! userlist global"
if {$bcast == "1"} {
  putserv "PRIVMSG $home :$nick!$host requested the global userlist ..showing.."
  }
  putserv "NOTICE $nick :Current global users listing:"
  putserv "NOTICE $nick :[userlist f]"
  putserv "NOTICE $nick :For details on a specified user type (/msg) $botnick access <user>"
  }
  }


